The HTTP 304 Not Modified
client redirection response code indicates that the server is telling the client that the resource at the requested URL hasn't changed since the last time the client downloaded it.
Here's a breakdown of key aspects:
Purpose: To reduce network bandwidth usage and improve website performance by allowing the client to reuse a previously cached version of the resource.
How it Works: The client sends a conditional request with an If-Modified-Since
or If-None-Match
header.
If-Modified-Since
: This header specifies the date and time the client last received the resource. The server compares this date with the resource's last modified date.If-None-Match
: This header specifies the ETag
(entity tag) value that the client previously received for the resource. The server compares this ETag
with the current ETag
of the resource.Server Response: If the resource hasn't been modified since the date specified in If-Modified-Since
, or if the ETag
in If-None-Match
matches the current ETag
, the server responds with a 304 Not Modified
status code. The server should not include a message body in the response.
Client Action: Upon receiving a 304
response, the client uses its cached version of the resource. The response effectively tells the client to refresh its cache entry with the information from the server's response headers (e.g., updated expiry time).
Important Headers:
If-None-Match
conditional requests.If-Modified-Since
.Benefit: Significantly reduces the amount of data transferred between the server and the client. This leads to faster page load times and lower bandwidth costs, especially for resources that don't change frequently.
Common Use Cases: Caching static assets like images, CSS files, and JavaScript files.
Requirements: The server must correctly implement conditional GET requests using If-Modified-Since
and/or If-None-Match
headers. It also needs to accurately manage ETag
and Last-Modified
values.
Ne Demek sitesindeki bilgiler kullanıcılar vasıtasıyla veya otomatik oluşturulmuştur. Buradaki bilgilerin doğru olduğu garanti edilmez. Düzeltilmesi gereken bilgi olduğunu düşünüyorsanız bizimle iletişime geçiniz. Her türlü görüş, destek ve önerileriniz için iletisim@nedemek.page